<template>
  <div id="app">
    <topbar v-bind:dataList="dataList"></topbar>
    <el-col :span="18">
      <product v-on:addToShoppingCart="addToShoppingCart"></product>
    </el-col>
    <el-col :span="6">
      <cart class="" v-bind:dataList="dataList"></cart>
    </el-col>
  </div>
</template>

<script>
import topbar from './components/header.vue';
import product from './components/product.vue';
import cart from './components/shopping-cart.vue';

export default {
  name: 'app',
  components: {
    topbar,
    product,
    cart
  },
  data() {
    return {
      dataList: [],
    }
  },
  methods:{
    addToShoppingCart(value){
      this.dataList.push(value);
    },
  }
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
